package cn.shlbysj.demo.service.impl;

import cn.shlbysj.demo.entity.OnlineExp;
import cn.shlbysj.demo.entity.OnlineExpExample;
import cn.shlbysj.demo.entity.VideoInfo;
import cn.shlbysj.demo.entity.VideoInfoExample;
import cn.shlbysj.demo.mapper.OnlineExpMapper;
import cn.shlbysj.demo.mapper.VideoInfoMapper;
import cn.shlbysj.demo.service.IVideoInfoService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("videoInfoService")
@Transactional
public class IVideoInfoServiceImpl implements IVideoInfoService {

    @Autowired
    private VideoInfoMapper videoInfoDao;

    @Override
    public List<VideoInfo> getList() {
        PageHelper.startPage(1,9);
        VideoInfoExample example=new VideoInfoExample();
        example.setOrderByClause("`create_time` desc");
        VideoInfoExample.Criteria criteria = example.createCriteria();
        Page<VideoInfo> list =(Page<VideoInfo>)videoInfoDao.selectByExample(example);
        return list.getResult();
    }
}
